﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UniversaleMain.Master" AutoEventWireup="true" CodeBehind="OrdersSummary.aspx.cs" Inherits="FYPDemo.OrdersSummary" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:GridView ID="Orders_Summary_GV" runat="server" AllowPaging="true" 
          AutoGenerateColumns="False" PageSize="5" DataKeyNames="OrderID" 
            onselectedindexchanged="Orders_Summ_Grid_SelectedIndexChanged"
            onpageindexchanging="Orders_Summ_Grid_PageIndexChanging">
            <Columns>
                <asp:TemplateField HeaderText="No.">
                    <ItemTemplate>
                        <%# Container.DataItemIndex + 1 %>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Order ID">
                    <ItemTemplate>
                        <script type="text/javascript">
                            var testing1 = '<%#Eval("OrderID") %>';
                         </script>
                         
                            <asp:LinkButton ID="linkTitle" runat="server" CommandArgument="Title" CommandName="Select" Text='<%#Bind("OrderID") %>'></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText = "Date Created">
                    <ItemTemplate>
                        <asp:Label ID="lblDateCreated" runat="server"><%#Eval("DateCreated") %></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText = "Total Price">
                    <ItemTemplate>
                        <asp:Label ID="lblTotalPrice" runat="server"><%#Eval("TotalPrice") %></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
             </Columns>
          </asp:GridView>

          <div id="order_details" style="display:block" runat="server">
            <table>
                <tr>
                    <td>
                        <asp:Label ID="lblOrderID" runat="server"></asp:Label>
                    </td>
                </tr>

                <tr>
                    <td>
                         <asp:GridView ID="Order_Details_GV" runat="server" AllowPaging="true" 
                            AutoGenerateColumns="False" PageSize="5"
                            onpageindexchanging="Order_Details_Grid_PageIndexChanging">
                            <Columns>
                                <asp:TemplateField HeaderText="No.">
                                    <ItemTemplate>
                                        <%# Container.DataItemIndex + 1 %>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Product Image">
                                    <ItemTemplate>
                                        <asp:Image ID="ProductImage" runat="server" Height="50px" Width="50px" ImageUrl='<%#Eval("ImagePath") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText ="Product ID">
                                    <ItemTemplate>
                                        <asp:Label ID="lblProductID" runat="server"><%#Eval("ProductID") %></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                               <asp:TemplateField HeaderText = "Quantity">
                                    <ItemTemplate>
                                        <asp:Label ID="lblQuantity" runat="server"><%#Eval("Quantity") %></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText = "Price">
                                    <ItemTemplate>
                                        <asp:Label ID="lblPrice" runat="server"><%#Eval("Price") %></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText = "Vendor Name">
                                    <ItemTemplate>
                                        <asp:Label ID="lblDateCreated" runat="server"><%#Eval("SupplierName") %></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                             </Columns>
                      </asp:GridView>
                    </td>
                </tr>

                <tr>
                    <td>
                        Total Price: <asp:Label ID="lblTotalPrice2" runat="server"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="btnPay" runat="server" Text="Pay" onclick="btnPay_Click" Enabled = "false" CssClass="buttonbg" />
                    </td>
                </tr>
            </table>
                
          </div>
</asp:Content>
